Repository navigation
BE-930: Add memory, thread and disk limits to the workspace - #10003
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #10003 +/- ##
==========================================
+ Coverage 68.10% 68.12% +0.01%
==========================================
Files 2034 2035 +1
Lines 207919 207996 +77
Branches 9032 9039 +7
==========================================
+ Hits 141612 141689 +77
Misses 64548 64548
Partials 1759 1759
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
thehabbos007
force-pushed
the
asa/hash-integrations/04b-engine-limits
branch
from
October 13, 2026 07:45
b241522 to
8f8ddc7
Compare
thehabbos007
force-pushed
the
asa/hash-integrations/04b-engine-limits
branch
from
October 13, 2026 09:05
8f8ddc7 to
fe46e4a
Compare
thehabbos007
force-pushed
the
asa/hash-integrations/04b-engine-limits
branch
from
October 13, 2026 10:15
fe46e4a to
29f3584
Compare
thehabbos007
force-pushed
the
asa/hash-integrations/04b-engine-limits
branch
from
October 13, 2026 19:53
29f3584 to
9812312
Compare
montekki
force-pushed
the
asa/hash-integrations/04b-engine-limits
branch
from
October 19, 2026 12:34
3c8acb8 to
100b5ef
Compare
montekki
force-pushed
the
asa/hash-integrations/04b-engine-limits
branch
from
October 19, 2026 12:45
100b5ef to
1a598d5
Compare
montekki
force-pushed
the
asa/hash-integrations/04b-engine-limits
branch
from
October 21, 2026 11:41
1a598d5 to
9888ede
Compare
montekki
force-pushed
the
asa/hash-integrations/04b-engine-limits
branch
from
October 21, 2026 11:50
9888ede to
1a45678
Compare
thehabbos007
force-pushed
the
asa/hash-integrations/04b-engine-limits
branch
from
October 26, 2026 20:50
1a45678 to
be813a1
Compare
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Disk accounting measures symbolic links rather than their targets, allowing oversized workspace files to pass the configured limit.
1 open issue
What changed in this PR
Adds configurable resource limits to the integration engine’s DuckDB workspaces through WorkspaceConfig.
Changes:
- Configures DuckDB memory, temporary-disk, and thread limits.
- Checks combined database, log, and temporary-file usage on open and after statements, checkpointing before reporting excess usage.
- Adds public size and error types, documentation, and integration tests.
| File | Description |
|---|---|
libs/@local/integrations/engine/tests/workspace.rs |
Tests settings, disk accounting, checkpointing, and retained tables. |
libs/@local/integrations/engine/src/workspace/mod.rs |
Exposes resource settings and documents limit errors. |
libs/@local/integrations/engine/src/workspace/files.rs |
Identifies paths included in disk accounting. |
libs/@local/integrations/engine/src/workspace/error.rs |
Adds settings identifiers and disk-limit errors. |
libs/@local/integrations/engine/src/workspace/connection.rs |
Applies settings and enforces post-statement disk checks. |
libs/@local/integrations/engine/src/lib.rs |
Exports the new public types. |
libs/@local/integrations/engine/src/byte_size.rs |
Introduces a byte-size type for limits and reporting. |
Review effort: Balanced
montekki
previously approved these changes
Oct 28, 2026
montekki
previously approved these changes
Oct 28, 2026
montekki
approved these changes
Oct 28, 2026
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

🌟 Purpose
This PR lets a caller limit a workspace's memory, threads and disk use through
WorkspaceConfig.🔍 Changes
memory_limit,temp_directory_limitandthreadsset DuckDB'smemory_limit,max_temp_directory_sizeandthreadssettings.disk_limitlimits the combined size of the database file, its log and DuckDB's temporary directory. The workspace checks it on open and after eachqueryandcreate_table. When the files are over the limit, it checkpoints the log into the database file and measures again before it fails withDiskLimit.create_tablecan write past the limit, and the table it created stays in the database.